<?php

echo "已知三角形的边角长，计算对边\n";
echo "请输入三角形的边角长，各数据用英语逗号分隔：\n";
$count = fscanf(STDIN, "%f,%f,%f %s", $a, $b, $other,$beta);
if ($count > 3) {
    echo "请不要输入乱七八糟的东西~\n";
} else if ($count < 3) {
    echo "请按格式输入数据\n";
    die();
}
$c=round(sqrt($a*$a+pow($b,2)-2*$a*$b*cos($beta*pi()/180)),2);
echo "三角形对边的长度=$c\n";